package log

import (
	"log"
	"time"
)

const (
	LEVEL_FATAL   = "fatal"
	LEVEL_ERROR   = "error"
	LEVEL_WARNING = "warning"
	LEVEL_NOTICE  = "notice"
	LEVEL_INFO    = "info"
	LEVEL_DEBUG   = "debug"
)

func Fatal(msg string, context string) {

	Log(LEVEL_FATAL, msg, context)
}
func Error(msg string, context string) {

	Log(LEVEL_ERROR, msg, context)
}
func Warning(msg string, context string) {

	Log(LEVEL_WARNING, msg, context)
}
func Notice(msg string, context string) {

	Log(LEVEL_NOTICE, msg, context)
}
func Info(msg string, context string) {

	Log(LEVEL_INFO, msg, context)
}
func Debug(msg string, context string) {
	Log(LEVEL_DEBUG, msg, context)
}

func Log(level string, msg string, context string) {

	log.Printf("[%s] %s - %s | %s\n", level, time.Now().Format("2006-01-02 15:04:05.000000"), msg, context)
}
